import request from '@/utils/request'

// 办理入住
export function addCheckIn(data) {
  return request({
    url: '/checkIn/add',
    method: 'post',
    data
  })
}

// 修改记录
export function updateCheckIn(data) {
  return request({
    url: '/checkIn/update',
    method: 'put',
    data
  })
}

// 删除记录
export function deleteCheckIn(id) {
  return request({
    url: `/checkIn/delete/${id}`,
    method: 'delete'
  })
}

// 批量删除
export function batchDeleteCheckIn(ids) {
  return request({
    url: '/checkIn/batchDelete',
    method: 'post',
    data: ids
  })
}

// 退宿
export function checkout(recordId) {
  return request({
    url: `/checkIn/checkout/${recordId}`,
    method: 'put'
  })
}

// 调换房间
export function transfer(params) {
  return request({
    url: '/checkIn/transfer',
    method: 'put',
    params
  })
}

// 分页
export function getCheckInPage(params) {
  return request({
    url: '/checkIn',
    method: 'get',
    params
  })
}

// 详情
export function getCheckInById(id) {
  return request({
    url: `/checkIn/queryById/${id}`,
    method: 'get'
  })
}